#ifndef __READER_DATABASE_INCLUDE__
#define __READER_DATABASE_INCLUDE__

class CReaderDatabase {
protected:
	CReaderDatabase();
	~CReaderDatabase();

public:
	static CReaderDatabase& GetSingleton();

	bool Open(const char* pFile);
	void Close();

	bool SetValue(LPCTSTR pName, LPCTSTR pValue);
	bool GetValue(LPCTSTR pName, LPTSTR pValue, DWORD dwSize);

	bool Update(CGoogleReader* pReader);

	bool GetList(std::vector<Subscription>& List);
	bool GetItems(int nSID, std::vector<Item>& Items);
	bool GetItem(int nCID, Item& Value);

	void ParseBody(const char* pBody, std::vector<std::string>& Images);
	int GetImageSeq(const char* pUrl);

private:
	int DownloadImage(CGoogleReader* pReader, const char* pUrl);
};

#endif
